import {createBrowserRouter, redirect} from "react-router";
import Main from "../main/Main.tsx";
import EditMenu from "../module/menu/EditMenu.tsx";

const LoginRoute = () => {
    return createBrowserRouter([
        {
            path: "/",
            loader: () => {
                return redirect("/home");
            },
            element: null,
        },
        {
            path: "/home",
            element: <Main/>,
            children: [{
                path: "/home/:menuId",
                element: <Main/>,
            }]
        },
        {
            path: "/editmenu/:id",
            element: <EditMenu editView={"form_menu_edit"}/>
        }
    ])
};

export default LoginRoute;